<%-- 
    Document   : CariDataBarang
    Created on : Dec 10, 2013, 4:24:37 PM
    Author     : owner
--%>

<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="Database.Koneksi"%>
<%@page import="java.sql.Connection"%>
<%@page import="Bean.Konsumen"%>
<%@page import="Bean.Barang_Konsumen"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin - Cari Data Barang</title>
        <link href="../css/style.css" rel="stylesheet" type="text/css"/>
    </head>
    <body id="home">
        <div id="wrapper">
            <center>
                </br>
                <center><img src="../image/header.png" width="600" height="100"/></center>
                <h1 align='right'> <a href="../HomePusat.jsp"><img src="../image/btn_home.png" width="100" height="40"/></a>
                    <a href="../FormLogin.jsp"><img src="../image/logout.png" width="100" height="40"/></a></h1>
                <form>
                    <input type="text" name="cari" class="field1" />
                    <input type="submit" value="cari" name="cariButton" />
                    <%
                        String kode = request.getParameter("cari");
                        Bean.Barang_Konsumen bk = new Barang_Konsumen();
                        Bean.Konsumen k = new Konsumen();
                        ResultSet r1 = bk.cariData(kode);
                        ResultSet r2 = k.cariDataKonsumen(kode);
                    %>
                    </br></br>
                    <table border="1">
                        <tr>
                            <td width="200" align="center" bgcolor="663300"><font color="white">NO RESI</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">TANGGAL KIRIM</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">TANGGAL TERIMA</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">STATUS</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">NAMA PENGIRIM</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">ALAMAT PENGIRIM</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">NO. TLP PENGIRIM</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">NAMA PENERIMA</font></td>
                            <td width="200" align="center" bgcolor="663300"><font color="white">ALAMAT PENERIMA</font></td>
                        </tr>
                        <%
                            while (r1.next() && r2.next()) {
                        %>
                        <TR>
                            <TD><%=r1.getString("NO_RESI")%></TD>
                            <TD><%=r1.getString("TANGGAL_KIRIM")%></TD>
                            <TD><%=r1.getString("TANGGAL_TERIMA")%></TD>
                            <TD><%=r1.getString("STATUS")%></TD>

                            <TD><%=r2.getString("NAMA_PENGIRIM")%></TD>
                            <TD><%=r2.getString("ALAMAT_PENGIRIM")%></TD>
                            <TD><%=r2.getString("N0_TELEPON_PENGIRIM")%></TD>
                            <TD><%=r2.getString("NAMA_PENERIMA")%></TD>
                            <TD><%=r2.getString("ALAMAT_PENERIMA")%></TD>
                        </TR>
                        <% }
                        %>
                    </table>
                </form>
            </center>
        </div>
    </body>
</html>